#!/usr/bin/env bats

@test "static no-recur: static (when dynamic is the same as static, nothing happens)" {
  cd $BATS_TEST_DIRNAME
  expected="file1:1:To understand how Gerrit works, let’s follow a change through its entire life
file1:6:In this walkthrough, we’ll follow two developers, Max and Hannah, as they make
file1:7:and review a change to a RecipeBook project. We’ll follow the change through"
  result="$(fish -c 'tbgs and')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs no-recur and')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs and no-recur')"; [ "$result" = "$expected" ]
}

@test "static no-recur: dynamic overwrites static" {
  cd $BATS_TEST_DIRNAME
  expected="file1:1:To understand how Gerrit works, let’s follow a change through its entire life
file1:6:In this walkthrough, we’ll follow two developers, Max and Hannah, as they make
file1:7:and review a change to a RecipeBook project. We’ll follow the change through
fileDir2/file2:6:other languages and discuss the"
  result="$(fish -c 'tbgs recur and')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs and recur')"; [ "$result" = "$expected" ]
}
